package org.travel_system.service.impl;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.travel_system.mapper.EvaluationMapper;
import org.travel_system.pojo.Evaluation;
import org.travel_system.service.EvaluationService;

import java.util.List;

@Service
public class EvaluationServiceImpl implements EvaluationService {

    private final EvaluationMapper evaluationMapper;

    @Autowired
    public EvaluationServiceImpl(EvaluationMapper evaluationMapper) {
        this.evaluationMapper = evaluationMapper;
    }

    @Override
    public List<Evaluation> getEvaluations(Integer userId) {
        return evaluationMapper.getEvaluations(userId);
    }

    @Override
    public Evaluation getEvaluationById(int id) {
        return evaluationMapper.getEvaluationById(id);
    }

    @Override
    public int addEvaluation(Evaluation evaluation) {
        return evaluationMapper.addEvaluation(evaluation);
    }

    @Override
    public int deleteEvaluationById(int id) {
        return evaluationMapper.deleteEvaluationById(id);
    }
}
